import type { AppRouteRecordRaw } from '/@/router/types';
import { t } from '/@/hooks/web/useI18n';
import { LAYOUT } from '/@/router/constant';

// 价格大数据
export const sourcingBigDataRoutes: AppRouteRecordRaw = {
  path: '/sourcingBigData',
  name: 'SourcingBigData',
  component: LAYOUT,
  redirect: '/sourcingBigData/priceSourcing',
  meta: {
    icon: 'ion:grid-outline',
    title: t('价格大数据'),
  },
  children: [
    {
      path: 'priceSourcing',
      name: 'PriceSourcing',
      component: () => import('/@/views/sourcingBigData/priceSourcing/index.vue'),
      meta: {
        affix: true,
        title: t('商品价格寻源'),
      },
    },
    {
      path: 'productDetail/:goodsCode',
      name: 'ProductDetail',
      component: () => import('../../views/sourcingBigData/productDetail/detail.vue'),
      meta: {
        title: t('商品详情'),
      },
    },
    {
      path: 'priceLibrary',
      name: 'priceLibrary',
      component: () => import('/@/views/sourcingBigData/priceLibrary/index.vue'),
      meta: {
        affix: true,
        title: t('监理采购价格库'),
      },
    },
    {
      path: 'priceLibrarybyjl',
      name: 'priceLibrarybyjl',
      component: () => import('/@/views/sourcingBigData/priceLibrarybyjl/index.vue'),
      meta: {
        affix: true,
        title: t('内部采购价格库'),
      },
    },
    {
      path: 'priceLibrarybyadd',
      name: 'priceLibrarybyadd',
      component: () => import('/@/views/sourcingBigData/priceLibrarybyadd/index.vue'),
      meta: {
        affix: true,
        title: t('新增采购价格库'),
      },
    },
    {
      path: 'engineeringSourcing',
      name: 'EngineeringSourcing',
      component: () => import('/@/views/sourcingBigData/engineeringSourcing/index.vue'),
      meta: {
        title: t('工程服务寻源'),
      },
    }
  ],
};
// 供应商寻源
export const supplierSourcingRoutes: AppRouteRecordRaw = {
  path: '/supplierSourcingMain',
  name: 'SupplierSourcingMain',
  component: LAYOUT,
  redirect: '/supplierSourcingMain/engineeringSourcing',
  meta: {
    icon: 'ion:grid-outline',
    title: t('供应商寻源'),
  },
  children: [
    {
      path: 'engineeringSourcing',
      name: 'EngineeringSourcing',
      component: () => import('/@/views/sourcingBigData/engineeringSourcing/index.vue'),
      meta: {
        title: t('全国供应商查询'),
      },
    },
    {
      path: 'nbgyscx',
      name: 'Nbgyscx',
      component: () => import('/@/views/sourcingBigData/engineeringSourcing/nbgyscx.vue'),
      meta: {
        title: t('内部供应商查询'),
      },
    }
  ],
};
// 供应商管理
export const supplierManageRoutes: AppRouteRecordRaw = {
  path: '/supplierManage',
  name: 'SupplierManage',
  component: LAYOUT,
  redirect: '/supplierManage/collaborationLedger',
  meta: {
    icon: 'ion:grid-outline',
    title: t('供应商管理'),
  },
  children: [
    {
      path: 'collaborationLedger',
      name: 'CollaborationLedger',
      component: () => import('/@/views/supplierManage/collaborationLedger/index.vue'),
      meta: {
        affix: true,
        title: t('项目采购台账'),
      },
    },
    {
      path: 'supplierLedger',
      name: 'SupplierLedger',
      component: () => import('/@/views/supplierManage/supplierLedger/index.vue'),
      meta: {
        affix: true,
        title: t('供应商列表'),
      },
    },
    {
      path: 'roster',
      name: 'Roster',
      component: () => import('/@/views/supplierManage/roster/index.vue'),
      meta: {
        title: t('供应商名单'),
      },
    },
    {
      path: 'supplierSourcing',
      name: 'SupplierSourcing',
      component: () => import('/@/views/sourcingBigData/supplierSourcing/index.vue'),
      meta: {
        title: t('商品供应商寻源'),
      },
      children: [
        {
          path: 'list',
          name: 'SupplierSourcingList',
          component: () => import('/@/views/sourcingBigData/supplierSourcing/list.vue'),
          meta: {
            title: t('商品供应商寻源'),
          },
        },
        {
          path: 'detail',
          name: 'SupplierSourcingDetail',
          component: () => import('../../views/sourcingBigData/productDetail/detail.vue'),
          meta: {
            title: t('商品供应商寻源'),
          },
        },
      ],
    },
  ],
};
// 供应商评分
export const supplierRatingRoutes: AppRouteRecordRaw = {
  path: '/supplierRating',
  name: 'SupplierRating',
  component: LAYOUT,
  redirect: '/supplierRating/ratingList',
  meta: {
    icon: 'ion:grid-outline',
    title: t('供应商评分'),
  },
  children: [
    {
      path: 'ratingList',
      name: 'RatingList',
      component: () => import('/@/views/supplierRating/ratingList/index.vue'),
      meta: {
        affix: true,
        title: t('历史评分'),
      },
    },
    {
      path: 'ratingModel',
      name: 'RatingModel',
      component: () => import('/@/views/supplierRating/ratingModel/index.vue'),
      meta: {
        title: t('评分模型'),
      },
    },
    {
      path : "indicatorDetails",
      name : "IndicatorDetails",
      component : () => import("/@/views/supplierRating/ratingModel/components/IndicatorDetails.vue"),
      meta: {
        affix: false,
        title: t('指标详情'),
      },
    },
  ],
};
// 风险查询
export const riskInquiryRoutes: AppRouteRecordRaw = {
  path: '/riskInquiry',
  name: '',
  component: LAYOUT,
  redirect: '/riskInquiry/riskInquiry',
  meta: {
    icon: 'ion:grid-outline',
    title: t('风险查询'),
  },
  children: [
    {
      path: 'riskInquiry',
      name: 'RiskInquiry',
      component: () => import('/@/views/riskInquiry/riskInquiry/index.vue'),
      meta: {
        affix: true,
        title: t('风险查询'),
      },
    },
    {
      path: 'riskScanning',
      name: 'RiskScanning',
      component: () => import('/@/views/riskInquiry/riskScanning/index.vue'),
      meta: {
        title: t('风险扫描'),
      },
    },
  ],
};
// 监控中心
export const monitoringCenterRoutes: AppRouteRecordRaw = {
  path: '/monitoringCenter',
  name: 'MonitoringCenter',
  component: LAYOUT,
  redirect: '/monitoringCenter/monitoringDynamics',
  meta: {
    icon: 'ion:grid-outline',
    title: t('监控中心'),
  },
  children: [
    {
      path: 'monitoringDynamics',
      name: 'MonitoringDynamics',
      component: () => import('/@/views/monitoringCenter/monitoringDynamics/index.vue'),
      meta: {
        affix: true,
        title: t('监控动态'),
      },
    },
    {
      path: 'enterpriseMonitoringList',
      name: 'EnterpriseMonitoringList',
      component: () => import('/@/views/monitoringCenter/enterpriseMonitoringList/index.vue'),
      meta: {
        title: t('企业监控列表'),
      },
    },
    {
      path: 'enterpriseReports',
      name: 'EnterpriseReports',
      component: () => import('/@/views/monitoringCenter/enterpriseReports/index.vue'),
      meta: {
        title: t('企业报告'),
      },
    },
    {
      path: 'monitoringModelConfiguration',
      name: 'MonitoringModelConfiguration',
      component: () => import('/@/views/monitoringCenter/monitoringModelConfiguration/index.vue'),
      meta: {
        title: t('监控模型配置'),
      },
    },
  ],
};

// 系统管理
export const systemRoutes: AppRouteRecordRaw = {
  path: '/system',
  name: 'System',
  component: LAYOUT,
  redirect: '/system/user',
  meta: {
    icon: 'ion:grid-outline',
    title: t('系统管理'),
  },
  children: [
    {
      path: 'user',
      name: 'User',
      component: () => import('/@/views/system/user/index.vue'),
      meta: {
        affix: true,
        title: t('用户管理'),
      },
    },
    {
      path: 'role',
      name: 'Role',
      component: () => import('/@/views/system/role/index.vue'),
      meta: {
        title: t('角色管理'),
      },
    },
  ],
};
